﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Movies
{
    public class DTOFilter
    {
        private string m_title = null;
        
        public string Title
        {
            get
            {
                return m_title;
            }
            set
            {
                m_title = value;
            }
        }


        private double m_ratingHigh = 0;

        public double RatingHigh
        {
            get
            {
                return m_ratingHigh;
            }
            set
            {
                m_ratingHigh = value;
            }
        }

        private double m_ratingLow = 10;

        public double RatingLow
        {
            get
            {
                return m_ratingLow;
            }
            set
            {
                m_ratingLow = value;
            }
        }

        private int m_releaseYear = 0;
        private int m_tillYear = 0;

        public int ReleaseYear
        {
            get
            {
                if (m_releaseYear < m_tillYear)
                {
                    int temp = m_releaseYear;
                    m_releaseYear = m_tillYear;
                    m_tillYear = temp;
                }
                return m_releaseYear;
            }
            set
            {
                m_releaseYear = value;
            }
        }

        public int TillYear
        {
            get
            {
                if (m_releaseYear < m_tillYear)
                {
                    int temp = m_releaseYear;
                    m_releaseYear = m_tillYear;
                    m_tillYear = temp;
                }else if(m_tillYear==0){
                    m_tillYear = m_releaseYear;
                }
                return m_tillYear;
            }
            set
            {
                m_tillYear = value;
            }
        }

        private void understandYearRange()
        {

        }

        private string m_rate = null;

        public string Rate
        {
            get
            {
                return m_rate;
            }
            set
            {
                m_rate = value;
            }
        }
        


        private string m_director = null;
        public string Director
        {
            get
            {
                return m_director;
            }
            set
            {
                m_director = value;
            }
        }


        private string m_cast = null;
        public string Cast
        {
            set
            {
                m_cast=value;
            }
        }

        public string[] GetCast()
        {
            if (m_cast != null)
            {
                return m_cast.Split(',');
            }
            else
            {
                return null;
            }
        }

        private string m_writer = null;
        public string Writer
        {
            set
            {
                m_writer = value;
            }
        }

        public String[] GetWriter()
        {
            if (m_writer != null)
            {
                return m_writer.Split(',');
            }
            else
            {
                return null;
            }
        }

        private List<string> m_genre = null;
        public List<string> Genre
        {
            set
            {
                m_genre = value;
            }
            get
            {
                return m_genre;
            }

        }

        public static int ALL = 0;
        public static int NOT_SEEN = 1;
        public static int ALL_SEEN = 2;


        private int m_seen = ALL;

        public int SeenStatus
        {
            get
            {
                return m_seen;
            }
            set
            {
                m_seen = value;
            }
        }


    }
}
